/*
 * Wazuh shared modules utils
 * Copyright (C) 2015, Wazuh Inc.
 * November 10, 2020.
 *
 * This program is free software; you can redistribute it
 * and/or modify it under the terms of the GNU General Public
 * License (version 2) as published by the FSF - Free Software
 * Foundation.
 */
#ifdef WIN32
#include "windowsHelper_test.h"
#include "windowsHelper.h"

void WindowsHelperTest::SetUp() {};

void WindowsHelperTest::TearDown() {};

TEST_F(WindowsHelperTest, ipv6NetMask_64)
{
    const int addressPrefixLength { 64 };
    const std::string expectedNetMask { "ffff:ffff:ffff:ffff::" };
    std::string netMask { Utils::NetworkWindowsHelper::ipv6Netmask(addressPrefixLength) };
    EXPECT_EQ(expectedNetMask, netMask);
}

TEST_F(WindowsHelperTest, ipv6NetMask_127)
{
    const int addressPrefixLength { 127 };
    const std::string expectedNetMask { "ffff:ffff:ffff:ffff:ffff:ffff:ffff:fffe" };
    std::string netMask { Utils::NetworkWindowsHelper::ipv6Netmask(addressPrefixLength) };
    EXPECT_EQ(expectedNetMask, netMask);
}

TEST_F(WindowsHelperTest, ipv6NetMask_55)
{
    const int addressPrefixLength { 55 };
    const std::string expectedNetMask { "ffff:ffff:ffff:fe::" };
    std::string netMask { Utils::NetworkWindowsHelper::ipv6Netmask(addressPrefixLength) };
    EXPECT_EQ(expectedNetMask, netMask);
}

TEST_F(WindowsHelperTest, ipv6NetMask_77)
{
    const int addressPrefixLength { 77 };
    const std::string expectedNetMask { "ffff:ffff:ffff:ffff:fff8::" };
    std::string netMask { Utils::NetworkWindowsHelper::ipv6Netmask(addressPrefixLength) };
    EXPECT_EQ(expectedNetMask, netMask);
}

TEST_F(WindowsHelperTest, ipv6NetMask_72)
{
    const int addressPrefixLength { 72 };
    const std::string expectedNetMask { "ffff:ffff:ffff:ffff:ff00::" };
    std::string netMask { Utils::NetworkWindowsHelper::ipv6Netmask(addressPrefixLength) };
    EXPECT_EQ(expectedNetMask, netMask);
}

TEST_F(WindowsHelperTest, ipv6NetMask_INVALID)
{
    const int addressPrefixLength { 130 };
    std::string netMask { Utils::NetworkWindowsHelper::ipv6Netmask(addressPrefixLength) };
    EXPECT_TRUE(netMask.empty());
}

TEST_F(WindowsHelperTest, getSerialNumberFromSMBIOSWithNullData_TEST)
{
    constexpr auto SERIAL_NUMBER_DATA { "" };
    std::string serialNumber;

    serialNumber = Utils::getSerialNumberFromSmbios(nullptr, 0);
    EXPECT_EQ(SERIAL_NUMBER_DATA, serialNumber);
}

TEST_F(WindowsHelperTest, getSerialNumberFromSMBIOSRealData_TEST)
{
    std::vector<unsigned char> rawData {0xda, 0xfb, 0x00, 0xda, 0xb2, 0x00, 0x37, 0x4f, 0x1e, 0x36, 0x00, 0x05, 0x00, 0x05, 0x00, 0x03, 0x00, 0x06, 0x00,
                                        0x06, 0x00, 0x05, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x11, 0x00, 0x11, 0x00, 0x02, 0x00, 0x12, 0x00, 0x12, 0x00, 0x04, 0x00, 0x22, 0x00,
                                        0x22, 0x00, 0x01, 0x00, 0x23, 0x00, 0x23, 0x00, 0x00, 0x00, 0x28, 0x00, 0x28, 0x00, 0x00, 0x00, 0x29, 0x00, 0x29, 0x00, 0x01, 0x00, 0x2a, 0x00,
                                        0x2a, 0x00, 0x02, 0x00, 0x2b, 0x00, 0x2b, 0x00, 0xff, 0xff, 0x2c, 0x00, 0x2c, 0x00, 0xff, 0xff, 0x2d, 0x00, 0x2d, 0x00, 0x02, 0x00, 0x2e, 0x00,
                                        0x2e, 0x00, 0x00, 0x00, 0x42, 0x00, 0x42, 0x00, 0x01, 0x00, 0x43, 0x00, 0x43, 0x00, 0x00, 0x00, 0x55, 0x00, 0x55, 0x00, 0x00, 0x00, 0x5c, 0x00,
                                        0x5c, 0x00, 0x01, 0x00, 0x5d, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x6d, 0x00, 0x05, 0x00, 0x6e, 0x00, 0x6e, 0x00, 0x01, 0x00, 0x90, 0x00,
                                        0x90, 0x00, 0x01, 0x00, 0x91, 0x00, 0x91, 0x00, 0x00, 0x00, 0x92, 0x00, 0x92, 0x00, 0x02, 0x00, 0x93, 0x00, 0x93, 0x00, 0x01, 0x00, 0x94, 0x00,
                                        0x94, 0x00, 0x00, 0x00, 0x97, 0x00, 0x97, 0x00, 0x01, 0x00, 0x98, 0x00, 0x98, 0x00, 0x00, 0x00, 0x9b, 0x00, 0x9b, 0x00, 0x01, 0x00, 0x9d, 0x00,
                                        0x9d, 0x00, 0x01, 0x00, 0x9e, 0x00, 0x9e, 0x00, 0x00, 0x00, 0x9f, 0x00, 0x9f, 0x00, 0x00, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0x01, 0x00, 0xa1, 0x00,
                                        0xa1, 0x00, 0x00, 0x00, 0xa2, 0x00, 0xa2, 0x00, 0x02, 0x00, 0xa3, 0x00, 0xa3, 0x00, 0x01, 0x00, 0xd1, 0x00, 0xd1, 0x00, 0x01, 0x00, 0xd2, 0x00,
                                        0xd2, 0x00, 0x00, 0x00, 0xed, 0x00, 0xed, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xda, 0xfb, 0x01, 0xda, 0xb2, 0x00,
                                        0x37, 0x4f, 0x1e, 0x36, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0x01, 0x00, 0xf5, 0x00, 0xf5, 0x00, 0x04, 0x00, 0xf6, 0x00, 0xf6, 0x00, 0x00, 0x00, 0x09,
                                        0x01, 0x09, 0x01, 0x00, 0x00, 0x17, 0x01, 0x17, 0x01, 0x00, 0x00, 0x18, 0x01, 0x18, 0x01, 0x01, 0x00, 0x19, 0x01, 0x19, 0x01, 0x00, 0x00, 0x1a,
                                        0x01, 0x1a, 0x01, 0x01, 0x00, 0x1b, 0x01, 0x1b, 0x01, 0x00, 0x00, 0x1c, 0x01, 0x1c, 0x01, 0x01, 0x00, 0x1d, 0x01, 0x1d, 0x01, 0x00, 0x00, 0x1e,
                                        0x01, 0x1e, 0x01, 0x01, 0x00, 0x2b, 0x01, 0x2b, 0x01, 0x01, 0x00, 0x2c, 0x01, 0x2c, 0x01, 0x00, 0x00, 0x2d, 0x01, 0x2d, 0x01, 0x01, 0x00, 0x2e,
                                        0x01, 0x2e, 0x01, 0x00, 0x00, 0x35, 0x01, 0x35, 0x01, 0xff, 0x00, 0x37, 0x01, 0x37, 0x01, 0x00, 0x00, 0x38, 0x01, 0x38, 0x01, 0x01, 0x00, 0x39,
                                        0x01, 0x39, 0x01, 0x02, 0x00, 0x40, 0x01, 0x40, 0x01, 0x00, 0x00, 0x41, 0x01, 0x41, 0x01, 0x01, 0x00, 0x44, 0x01, 0x44, 0x01, 0x00, 0x00, 0x45,
                                        0x01, 0x45, 0x01, 0x01, 0x00, 0x46, 0x01, 0x46, 0x01, 0x00, 0x00, 0x47, 0x01, 0x47, 0x01, 0x01, 0x00, 0x4a, 0x01, 0x4a, 0x01, 0x00, 0x00, 0x4b,
                                        0x01, 0x4b, 0x01, 0x01, 0x00, 0x4e, 0x01, 0x4e, 0x01, 0x00, 0x00, 0x4f, 0x01, 0x4f, 0x01, 0x01, 0x00, 0x54, 0x01, 0x54, 0x01, 0x00, 0x00, 0x55,
                                        0x01, 0x55, 0x01, 0x01, 0x00, 0x68, 0x01, 0x68, 0x01, 0x00, 0x00, 0x69, 0x01, 0x69, 0x01, 0x01, 0x00, 0x75, 0x01, 0x75, 0x01, 0x02, 0x00, 0x76,
                                        0x01, 0x76, 0x01, 0x01, 0x00, 0x9b, 0x01, 0x9b, 0x01, 0x00, 0x00, 0x9c, 0x01, 0x9c, 0x01, 0x01, 0x00, 0xd2, 0x01, 0xd2, 0x01, 0x00, 0x00, 0xff,
                                        0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xda, 0xfb, 0x02, 0xda, 0xb2, 0x00, 0x37, 0x4f, 0x1e, 0x36, 0x00, 0xd3, 0x01, 0xd3, 0x01, 0x01, 0x00,
                                        0xd4, 0x01, 0xd4, 0x01, 0x00, 0x00, 0xd5, 0x01, 0xd5, 0x01, 0x01, 0x00, 0xe8, 0x01, 0xe8, 0x01, 0x00, 0x00, 0xe9, 0x01, 0xe9, 0x01, 0x01, 0x00,
                                        0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x03, 0x02, 0x03, 0x02, 0x01, 0x00, 0x04, 0x02, 0x04, 0x02, 0x00, 0x00, 0x05, 0x02, 0x05, 0x02, 0x01, 0x00,
                                        0x2d, 0x02, 0x2d, 0x02, 0x01, 0x00, 0x2e, 0x02, 0x2e, 0x02, 0x00, 0x00, 0x32, 0x02, 0x32, 0x02, 0x02, 0x00, 0x33, 0x02, 0x33, 0x02, 0x01, 0x00,
                                        0x4a, 0x02, 0x4a, 0x02, 0x01, 0x00, 0x4b, 0x02, 0x4b, 0x02, 0x01, 0x00, 0x4c, 0x02, 0x4c, 0x02, 0x00, 0x00, 0x5b, 0x02, 0x5b, 0x02, 0x00, 0x00,
                                        0x5c, 0x02, 0x5c, 0x02, 0x01, 0x00, 0x64, 0x02, 0x64, 0x02, 0x01, 0x00, 0x65, 0x02, 0x65, 0x02, 0x00, 0x00, 0x66, 0x02, 0x66, 0x02, 0x01, 0x00,
                                        0x67, 0x02, 0x67, 0x02, 0x00, 0x00, 0x68, 0x02, 0x68, 0x02, 0x01, 0x00, 0x69, 0x02, 0x69, 0x02, 0x00, 0x00, 0x6c, 0x02, 0x6c, 0x02, 0x01, 0x00,
                                        0x6d, 0x02, 0x6d, 0x02, 0x00, 0x00, 0x6e, 0x02, 0x6e, 0x02, 0x00, 0x00, 0xa3, 0x02, 0xa3, 0x02, 0x01, 0x00, 0xa4, 0x02, 0xa4, 0x02, 0x00, 0x00,
                                        0xa7, 0x02, 0xa7, 0x02, 0x01, 0x00, 0xa8, 0x02, 0xa8, 0x02, 0x00, 0x00, 0xbd, 0x02, 0xbd, 0x02, 0x01, 0x00, 0xbe, 0x02, 0xbe, 0x02, 0x00, 0x00,
                                        0xcd, 0x02, 0xcd, 0x02, 0x01, 0x00, 0xd8, 0x02, 0xd8, 0x02, 0xff, 0xff, 0xd9, 0x02, 0xd9, 0x02, 0xff, 0xff, 0xda, 0x02, 0xda, 0x02, 0xff, 0xff,
                                        0xdb, 0x02, 0xdb, 0x02, 0xff, 0xff, 0xdc, 0x02, 0xdc, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xda, 0xfb, 0x03, 0xda,
                                        0xb2, 0x00, 0x37, 0x4f, 0x1e, 0x36, 0x00, 0xdd, 0x02, 0xdd, 0x02, 0xff, 0xff, 0xde, 0x02, 0xde, 0x02, 0xff, 0xff, 0xdf, 0x02, 0xdf, 0x02, 0xff,
                                        0xff, 0xe3, 0x02, 0xe3, 0x02, 0x01, 0x00, 0xe4, 0x02, 0xe4, 0x02, 0x00, 0x00, 0xe5, 0x02, 0xe5, 0x02, 0x01, 0x00, 0xfd, 0x02, 0xfd, 0x02, 0x01,
                                        0x00, 0xfe, 0x02, 0xfe, 0x02, 0x00, 0x00, 0x0f, 0x03, 0x0f, 0x03, 0x02, 0x00, 0x12, 0x03, 0x12, 0x03, 0x03, 0x00, 0x13, 0x03, 0x13, 0x03, 0x01,
                                        0x00, 0x14, 0x03, 0x14, 0x03, 0x00, 0x00, 0x15, 0x03, 0x15, 0x03, 0x01, 0x00, 0x16, 0x03, 0x16, 0x03, 0x00, 0x00, 0x17, 0x03, 0x17, 0x03, 0x01,
                                        0x00, 0x18, 0x03, 0x18, 0x03, 0x00, 0x00, 0x19, 0x03, 0x19, 0x03, 0x01, 0x00, 0x1a, 0x03, 0x1a, 0x03, 0x00, 0x00, 0x1b, 0x03, 0x1b, 0x03, 0x01,
                                        0x00, 0x1c, 0x03, 0x1c, 0x03, 0x00, 0x00, 0x1d, 0x03, 0x1d, 0x03, 0x01, 0x00, 0x1e, 0x03, 0x1e, 0x03, 0x00, 0x00, 0x1f, 0x03, 0x1f, 0x03, 0x01,
                                        0x00, 0x20, 0x03, 0x20, 0x03, 0x00, 0x00, 0x25, 0x03, 0x25, 0x03, 0x01, 0x00, 0x26, 0x03, 0x26, 0x03, 0x01, 0x00, 0x4f, 0x03, 0x4f, 0x03, 0x01,
                                        0x00, 0x50, 0x03, 0x50, 0x03, 0x00, 0x00, 0x57, 0x03, 0x57, 0x03, 0x00, 0x00, 0x58, 0x03, 0x58, 0x03, 0x01, 0x00, 0x61, 0x03, 0x61, 0x03, 0x01,
                                        0x00, 0x62, 0x03, 0x62, 0x03, 0x00, 0x00, 0x69, 0x03, 0x69, 0x03, 0x00, 0x00, 0x6a, 0x03, 0x6a, 0x03, 0x01, 0x00, 0x6b, 0x03, 0x6b, 0x03, 0x02,
                                        0x00, 0x83, 0x03, 0x83, 0x03, 0x07, 0x00, 0x3e, 0x40, 0x3e, 0x40, 0x00, 0x00, 0x3f, 0x40, 0x3f, 0x40, 0x01, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00,
                                        0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xda, 0x4d, 0x04, 0xda, 0xb2, 0x00, 0x37, 0x4f, 0x1e, 0x36, 0x00, 0x02, 0x80, 0x02, 0x80,
                                        0x02, 0x00, 0x03, 0x80, 0x03, 0x80, 0x03, 0x00, 0x0c, 0x80, 0x0c, 0x80, 0x00, 0x00, 0x0d, 0x80, 0x0d, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x00, 0xa0,
                                        0x01, 0x00, 0x04, 0xa0, 0x04, 0xa0, 0x01, 0x00, 0x00, 0xf0, 0x00, 0xf0, 0x55, 0x00, 0x02, 0xf0, 0x02, 0xf0, 0x03, 0x00, 0x05, 0xf0, 0x05, 0xf0,
                                        0x7f, 0x00, 0x06, 0xf0, 0x06, 0xf0, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x01, 0x02, 0x00, 0xf0,
                                        0x03, 0xbf, 0x80, 0x9a, 0x8b, 0x3f, 0x01, 0x00, 0x17, 0x00, 0x03, 0x0f, 0x04, 0x06, 0xff, 0xff, 0x44, 0x65, 0x6c, 0x6c, 0x20, 0x49, 0x6e, 0x63,
                                        0x2e, 0x00, 0x41, 0x30, 0x31, 0x00, 0x30, 0x38, 0x2f, 0x31, 0x33, 0x2f, 0x32, 0x30, 0x31, 0x33, 0x00, 0x00, 0x01, 0x1b, 0x01, 0x00, 0x01, 0x02,
                                        0x03, 0x04, 0x44, 0x45, 0x4c, 0x4c, 0x59, 0x00, 0x10, 0x44, 0x80, 0x38, 0xb6, 0xc0, 0x4f, 0x35, 0x59, 0x31, 0x06, 0x05, 0x06, 0x44, 0x65, 0x6c,
                                        0x6c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x00, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x45, 0x64, 0x67, 0x65, 0x20, 0x54, 0x32, 0x30, 0x00, 0x30, 0x31, 0x00,
                                        0x36, 0x59, 0x44, 0x38, 0x35, 0x59, 0x31, 0x00, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x45, 0x64, 0x67, 0x65, 0x20, 0x54, 0x32, 0x30, 0x00, 0x20, 0x00,
                                        0x00, 0x02, 0x0f, 0x02, 0x00, 0x01, 0x02, 0x03, 0x04, 0x00, 0x09, 0x00, 0x03, 0x00, 0x0a, 0x00, 0x44, 0x65, 0x6c, 0x6c, 0x20, 0x49, 0x6e, 0x63,
                                        0x2e, 0x00, 0x30, 0x56, 0x44, 0x35, 0x48, 0x59, 0x00, 0x41, 0x30, 0x30, 0x00, 0x2f, 0x36, 0x59, 0x44, 0x38, 0x35, 0x59, 0x31, 0x2f, 0x43, 0x4e,
                                        0x37, 0x32, 0x32, 0x30, 0x30, 0x33, 0x39, 0x33, 0x30, 0x30, 0x33, 0x39, 0x2f, 0x00, 0x20, 0x00, 0x20, 0x00, 0x00};

    const auto size { rawData.size() };
    constexpr auto SERIAL_NUMBER_DATA { "/6YD85Y1/CN722003930039/" };
    std::string serialNumber;

    const auto smbios { reinterpret_cast<PRawSMBIOSData>(rawData.data()) };
    serialNumber = Utils::getSerialNumberFromSmbios(smbios->SMBIOSTableData, size);
    EXPECT_EQ(SERIAL_NUMBER_DATA, serialNumber);
}

TEST_F(WindowsHelperTest, getSerialNumberFromSMBIOSCorruptedData1_TEST)
{
    const std::vector<unsigned char> rawData {0x0, 0x0, 0x2, 0x2, 0x0, 0x0, 0x0, 0x0, 0xff, 0x27, 0xc7};
    const auto size { rawData.size() };
    constexpr auto SERIAL_NUMBER_DATA { "" };
    std::string serialNumber;

    serialNumber = Utils::getSerialNumberFromSmbios(rawData.data(), size);
    EXPECT_EQ(SERIAL_NUMBER_DATA, serialNumber);
}


TEST_F(WindowsHelperTest, getSerialNumberFromSMBIOSCorruptedData2_TEST)
{
    const std::vector<unsigned char> rawData {0x2, 0x0, 0xff, 0xff, 0xff, 0xff, 0x0, 0x5, 0xa};
    const auto size { rawData.size() };
    constexpr auto SERIAL_NUMBER_DATA { "" };
    std::string serialNumber;

    serialNumber = Utils::getSerialNumberFromSmbios(rawData.data(), size);
    EXPECT_EQ(SERIAL_NUMBER_DATA, serialNumber);
}

TEST_F(WindowsHelperTest, getSerialNumberFromSMBIOSTablesNoEndDoubleNull_TEST)
{
    const std::vector<unsigned char> rawData {0xda, 0xfb, 0x00, 0xda, 0xb2, 0x00, 0x37, 0x4f, 0x1e, 0x36, 0x00, 0x05, 0x00, 0x05, 0x00, 0x03, 0x00, 0x06, 0x00,
                                              0x06, 0x00, 0x05, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x11, 0x00, 0x11, 0x00, 0x02, 0x00, 0x12, 0x00, 0x12, 0x00, 0x04, 0x00, 0x22};
    const auto size { rawData.size() };
    constexpr auto SERIAL_NUMBER_DATA { "" };
    std::string serialNumber;

    serialNumber = Utils::getSerialNumberFromSmbios(rawData.data(), size);
    EXPECT_EQ(SERIAL_NUMBER_DATA, serialNumber);
}

TEST_F(WindowsHelperTest, getSerialNumberFromSMBIOSTables2NoEndDoubleNull_TEST)
{
    const std::vector<unsigned char> rawData {0x2, 0x8, 0xff, 0x00, 0x1, 0x2, 0x3, 0x4, 0x5, 0x0, 0x6, 0x0, 0x7, 0x0, 'S', 'e', 'r', 'i', 'a', 'l', ' ', 't', 'e', 's', 't'};
    const auto size { rawData.size() };
    constexpr auto SERIAL_NUMBER_DATA { "Serial test" };
    std::string serialNumber;

    serialNumber = Utils::getSerialNumberFromSmbios(rawData.data(), size);
    EXPECT_EQ(SERIAL_NUMBER_DATA, serialNumber);
}

TEST_F(WindowsHelperTest, normalizeTimestampShortRegistryInstallDateValue)
{
    std::string RegistryInstallDateValue = "202202";
    std::string RegistryModificationDateValue = "2022/02/15 14:04:50";

    EXPECT_ANY_THROW(Utils::normalizeTimestamp(RegistryInstallDateValue, RegistryModificationDateValue));
}

TEST_F(WindowsHelperTest, normalizeTimestampLongRegistryInstallDateValue)
{
    std::string RegistryInstallDateValue = "2022021516";
    std::string RegistryModificationDateValue = "2022/02/15 14:04:50";

    EXPECT_ANY_THROW(Utils::normalizeTimestamp(RegistryInstallDateValue, RegistryModificationDateValue));
}

TEST_F(WindowsHelperTest, normalizeTimestampUnknownRegistryInstallDateValue)
{
    std::string RegistryInstallDateValue;
    std::string RegistryModificationDateValue = "2022/02/15 14:04:50";

    EXPECT_ANY_THROW(Utils::normalizeTimestamp(RegistryInstallDateValue, RegistryModificationDateValue));
}

TEST_F(WindowsHelperTest, normalizeTimestampNotEqual)
{
    std::string RegistryInstallDateValue = "20220214";
    std::string RegistryModificationDateValue = "2022/02/15 14:04:50";
    std::string expected = "2022/02/14 00:00:00";

    std::string result = Utils::normalizeTimestamp(RegistryInstallDateValue, RegistryModificationDateValue);

    EXPECT_EQ(expected, result);
}

TEST_F(WindowsHelperTest, normalizeTimestampEqual)
{
    std::string RegistryInstallDateValue = "20220215";
    std::string RegistryModificationDateValue = "2022/02/15 14:04:50";
    std::string expected = "2022/02/15 14:04:50";

    std::string result = Utils::normalizeTimestamp(RegistryInstallDateValue, RegistryModificationDateValue);

    EXPECT_EQ(expected, result);
}

TEST_F(WindowsHelperTest, normalizeTimestampWrongRegistryInstallDateValue)
{
    std::string RegistryInstallDateValue = "a0220215";
    std::string RegistryModificationDateValue = "2022/02/15 23:59:59";

    EXPECT_ANY_THROW(Utils::normalizeTimestamp(RegistryInstallDateValue, RegistryModificationDateValue));
}

#endif
